// random number generators using Mersenne twister and polar Box-Muller transform
#ifndef RANDOM_H
#define RANDOM_H

// maximum value returned by rand
#define RANDOM_MAXRAND 4294967295

class Random
{
	unsigned int MT[624];
	unsigned int index;

	bool gaussStored;
	double tempGauss;

public:
	unsigned int count;
	Random();
	Random(unsigned int seed);
	~Random();

	// seed random number generator
	void seed();
	void seed(unsigned int seed);

	// generate array of 624 untempered numbers
	void refreshNumbers();

	// generate uniform random integers
	unsigned int rand();
	unsigned int rand(unsigned int max);
	unsigned int rand(unsigned int min, unsigned int max);

	// generate uniform random numbers
	double uniform();
	double uniform(double max);
	double uniform(double min, double max);

	// generate gaussian random numbers
	double gaussRand();
	double gaussRand(double stDev);
	double gaussRand(double mean, double stDev);
};

#endif